﻿using Zore.App.Shared.Helpers;

namespace App.Core.Result
{
    /// <summary>
    /// 统一响应结果
    /// </summary>
    public class UnifyResult
    {
        public UnifyResult()
        {
            StatusCode = ResultCode.Success;
            Message = StatusCode.GetDescription();
        }

        public UnifyResult(ResultCode code, object message = null)
        {
            StatusCode = code;
            Message = message ?? code.GetDescription();
        }

        public UnifyResult(object message, ResultCode code = ResultCode.Success)
        {
            Message = message;
            StatusCode = code;
        }


        /// <summary>
        /// 消息
        /// </summary>
        public object Message { get; set; }

        /// <summary>
        /// 状态值
        /// </summary>
        public ResultCode StatusCode { get; set; }
    }
}
